Skip to content

doc: fix Writable.write callback description#31812

Closed
ronag wants to merge 3 commits into
nodejs:masterfrom
nxtedition:stream-doc-writable-callback
Closed

doc: fix Writable.write callback description#31812
ronag wants to merge 3 commits into
nodejs:masterfrom
nxtedition:stream-doc-writable-callback

Conversation

@ronag

@ronag ronag commented Feb 15, 2020

Copy link
Copy Markdown
Member

Clarifies a userland invariant until a better
solution can be found.

Also moves a misplaced sentence from _write to
write.

Refs: #31756
Refs: #31765

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines

@ronag ronag added the stream Issues and PRs related to the stream subsystem. label Feb 15, 2020
@nodejs-github-bot nodejs-github-bot added the doc Issues and PRs related to the documentations. label Feb 15, 2020
@ronag

ronag commented Feb 15, 2020

Copy link
Copy Markdown
Member Author

@nodejs/streams

Clarifies a userland invariant until a better
solution can be found.

Also moves a misplaced sentence from _write to
write.

Refs: nodejs#31756
Refs: nodejs#31765
@ronag ronag force-pushed the stream-doc-writable-callback branch from 0cf3ff7 to 8c19c23 Compare February 15, 2020 13:17
@lpinca

lpinca commented Feb 15, 2020

Copy link
Copy Markdown
Member

I think this depends on #31317.

@ronag

ronag commented Feb 15, 2020

Copy link
Copy Markdown
Member Author

I think this depends on #31317.

How so? This is a timing issue related to when and how the _write callback is invoked by the user.

@lpinca

lpinca commented Feb 15, 2020

Copy link
Copy Markdown
Member

The callback method will always be called asynchronously

Perhaps I'm misunderstanding this? Note "always". Or does that mean that if the callback is called it will be called asynchronously?

@ronag

ronag commented Feb 15, 2020

Copy link
Copy Markdown
Member Author

Perhaps I'm misunderstanding this? Note "always". Or does that mean that if the callback is called it will be called asynchronously?

Ah now I see what you mean. That part was incorrectly written at _write() instead of write(). I just moved it to where it was intended. That was not the primary purpose of this PR.

And yes the "always" is a bit ambigious but I think the intention is that "is called it will be called asynchronously". Maybe removing "always" would amke it clearer?

Comment thread doc/api/stream.md Outdated
Co-Authored-By: Luigi Pinca <luigipinca@gmail.com>

@mcollina mcollina left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ronag ronag added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Feb 16, 2020
@ronag ronag requested a review from lpinca February 16, 2020 14:05
Comment thread doc/api/stream.md Outdated
Co-Authored-By: Luigi Pinca <luigipinca@gmail.com>
@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

@nodejs-github-bot

Copy link
Copy Markdown
Collaborator

ronag added a commit that referenced this pull request Feb 18, 2020
Clarifies a userland invariant until a better
solution can be found.

Also moves a misplaced sentence from _write to
write.

Refs: #31756
Refs: #31765

PR-URL: #31812
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
@ronag

ronag commented Feb 18, 2020

Copy link
Copy Markdown
Member Author

Landed in 7c524fb

@MylesBorins

Copy link
Copy Markdown
Contributor

This does not land cleanly on v13.x. Could you please open a backport PR if it should land on that branch

@lpinca

lpinca commented Mar 6, 2020

Copy link
Copy Markdown
Member

I think 75b30c6 must be backported first. Then this will land cleanly.

@lpinca

lpinca commented Mar 6, 2020

Copy link
Copy Markdown
Member

75b30c6 is semver-major, so this should not be backported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

author ready PRs that have at least one approval, no pending requests for changes, and a CI started. doc Issues and PRs related to the documentations. stream Issues and PRs related to the stream subsystem.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants